home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / interp / perl5.005.tar.gz / perl5.005.tar / perl5.005 / perl_exp.SH < prev    next >
Linux/UNIX/POSIX Shell Script  |  1998-07-22  |  3KB  |  114 lines

  1. #!/bin/sh
  2. #
  3. # Written: Nov 1994 Wayne Scott <wscott@ichips.intel.com>
  4. #
  5. # Updated: 1997-8 Jarkko Hietaniemi <jhi@iki.fi>
  6. #
  7. # Create the export list for perl.
  8. # Needed by AIX to do dynamic linking.
  9. #
  10. # This simple program relies on 'global.sym' and few other *.sym files
  11. # and the *var*.h files being up to date with all of the global
  12. # symbols that a dynamic link library might want to access.
  13. #
  14. # Most symbols have a Perl_ or PL_prefix because that's what embed.h
  15. # sticks in front of them.
  16. #
  17. # AIX requires the list of external symbols (variables or functions)
  18. # that are made available for another executable object file the import.
  19. # The list is called the export file and it is a simple text file.
  20. # The first line must be
  21. #!
  22. # That is, hash-bang, pound-shout, however you want to call it.
  23. # The remainder of the file are the names of the symbols, one per line.
  24. # The file is then given to the system loader (cc/xlc command line)
  25. # as -bE:export.file.
  26.  
  27. case $CONFIG in
  28. '')
  29.     if test -f config.sh; then TOP=.;
  30.     elif test -f ../config.sh; then TOP=..;
  31.     elif test -f ../../config.sh; then TOP=../..;
  32.     elif test -f ../../../config.sh; then TOP=../../..;
  33.     elif test -f ../../../../config.sh; then TOP=../../../..;
  34.     else
  35.         echo "Can't find config.sh."; exit 1
  36.     fi
  37.     . $TOP/config.sh
  38.     ;;
  39. esac
  40. : This forces SH files to create target in same directory as SH file.
  41. : This is so that make depend always knows where to find SH derivatives.
  42. case "$0" in
  43. */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  44. esac
  45.  
  46. echo "Extracting perl.exp"
  47.  
  48. rm -f perl.exp
  49. echo "#!" > perl.exp
  50.  
  51. # No compat3 since 5.004_50.
  52. # perlio.sym will added below if needed.
  53. syms="global.sym interp.sym thread.sym"
  54.  
  55. sed -n '/^[A-Za-z]/ s/^/Perl_/p' $syms                 >> perl.exp
  56.  
  57. sed -n 's/^PERLVAR.*(G\([^[,]*\).*/PL_\1/p' perlvars.h >> perl.exp
  58. sed -n 's/^PERLVAR.*(I\([^[,]*\).*/PL_\1/p' intrpvar.h >> perl.exp
  59. sed -n 's/^PERLVAR.*(T\([^[,]*\).*/PL_\1/p' thrdvar.h  >> perl.exp
  60.  
  61. # If we use the PerlIO abstraction layer, add its symbols
  62. #
  63.  
  64. if [ $useperlio = "define" ]
  65. then
  66.     grep '^[A-Za-z]' perlio.sym >> perl.exp
  67. fi
  68.  
  69. #
  70. # Extra globals not included above (including a few that might
  71. # not actually be defined, but there's no harm in that).
  72. #
  73.  
  74. cat <<END >> perl.exp
  75. perl_init_i18nl10n
  76. perl_init_i18nl14n
  77. perl_new_collate
  78. perl_new_ctype
  79. perl_new_numeric
  80. perl_set_numeric_local
  81. perl_set_numeric_standard
  82. perl_alloc
  83. perl_construct
  84. perl_destruct
  85. perl_free
  86. perl_parse
  87. perl_run
  88. perl_get_sv
  89. perl_get_av
  90. perl_get_hv
  91. perl_get_cv
  92. perl_call_argv
  93. perl_call_pv
  94. perl_call_method
  95. perl_call_sv
  96. perl_eval_pv
  97. perl_eval_sv
  98. perl_require_pv
  99. Mymalloc
  100. Mycalloc
  101. Myremalloc
  102. Myfree
  103. Perl_malloc
  104. Perl_calloc
  105. Perl_realloc
  106. Perl_free
  107. END
  108.  
  109. # The shebang line nicely sorts as the first one.
  110. sort -o perl.exp -u perl.exp
  111.  
  112. # eof
  113.